import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import java.util.Collection;



/**
*Teacher class.
* In this class i have use the list to store the name of teacher 
*/
class Teacher{
	//Use the list for teacher name
	void printNames(){
		List<String> nameList=new ArrayList<String>();

		nameList.add("Amit");
		nameList.add("Shashank");
		nameList.add("Rahul");
		nameList.add("Deepika");
		System.out.println("Name of teacher in the List");		
		Iterator iterator=nameList.iterator();

		while(iterator.hasNext())
		{
			String name=(String)iterator.next();
		 	System.out.println("Name :"+name);
		}
		
	}
	
	//Use the Map for teacher name
	void selectTeacher(int teacherNumber){
		
		MyInterfaceTest myInterfacetest=new MyInterfaceTest();
		//System.out.println("Name of teacher:"+teacherName);
		Map<Object,String> teacherMap=new HashMap<Object, String>();
		Map<Object,String> teacherMap1=new HashMap<Object, String>();

		teacherMap.put(new Integer(1), "Amit");
		teacherMap.put(new Integer(2), "Shashank");
		teacherMap.put(new Integer(3), "Rahul");
		teacherMap.put(new Integer(4), "Deepika");

		Set set=teacherMap.entrySet();

		Iterator itetator=set.iterator();

		while(itetator.hasNext())
		{
		     Map.Entry m =(Map.Entry)itetator.next();

		     int key=(Integer)m.getKey();

		     String value=(String)m.getValue();
			if(key==teacherNumber){
				System.out.println("Name of student in Map whose key is :"+teacherNumber); 			
			       	System.out.println("Key :"+key+"  Value :"+value);
			}
		}

	}

	

}



